package com.zhiyuan.service;

import com.zhiyuan.dto.UserDTO;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


/**
 *
 *
 * @author zhiyuan
 *  2025/10/25
 */
@Service
public class UserService {
    @Cacheable(cacheNames = "user", key = "#id")
    public UserDTO findById(Long id) {

        return new UserDTO();
    }

    @CacheEvict(cacheNames = "user", key = "#u.id")
    @Transactional
    public void updateUser(UserDTO u) {

    }
}

